<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|	example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|	http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two reserved routes:
|
|	$route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
|	$route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/
$category = include_once("mcache/category_router.php");
foreach($category as $r){
	$route[$r] = 'uindex/category/'.$r;
	$route[$r.'/trang-(:num)'] = 'uindex/category/'.$r.'/$1';
	$route['choi-nhieu/'.$r] = 'uindex/category/'.$r .'/0/topview';
	$route['choi-nhieu/'.$r.'/trang-(:num)'] = 'uindex/category/'.$r.'/$1/topview';
	// $route[$r.'/trang-(:num)/(:any)'] = 'uindex/category/'.$r.'/$1/$2';
}

$route['rss/(:any)'] = "rss/category/$1";
$route['choi-game/(:any)'] = "uindex/play/$1";
$route['dau-truong/(:any)'] = "uindex/arena/$1";
$route['thong-tin/(:any)'] = "uindex/info_detail/$1";

$route['token'] = "gamescore/get_token";
$route['newscore'] = "gamescore/newscore";
$route['tim-kiem'] = "uindex/search";
$route['tim-kiem/(:any)/trang-(:num)'] = "uindex/search/$1/$2";
$route['tim-kiem/(:any)'] = "uindex/search/$1";

$route['play-game'] = "uindex/series";
$route['play-game/(:any)/trang-(:num)'] = "uindex/series/$1/$2";
$route['play-game/(:any)'] = "uindex/series/$1";

$route['index.php?act=Arcade&do=newscore'] = "uindex/gamescore";


$route['dang-ky'] = "user/index";
$route['dang-nhap'] = "user/login";
$route['dang-xuat'] = "user/logout";
$route['quen-mat-khau'] = "user/lost_password";
$route['recovery'] = "user/recovery_passwd";
$route['recovery/(:any)'] = "user/recovery_passwd/$1/$2";


$route['dang-nhap-facebook'] = "social/facebook";
$route['redirect-facebook'] = "social/redirect";
$route['thong-tin-ca-nhan'] = "user/index";
$route['thanh-vien/(:any)'] = "user/info/$1";
$route['ajax/chang-info'] = "user/change";
$route['game-yeu-thich'] = "user/favorites";

$route['admin/nopermission'] = "admin/uindex/nopermission";
$route['admin/(:any)/index/trang-(:num)'] = "admin/$1/index/$2";

//module
$route['game-moi-nhat'] = "module/load/ultimate_games/new_game/54/0";
$route['game-moi-nhat/trang-(:num)'] = "module/load/ultimate_games/new_game/54/$1";

$route['game-choi-nhieu'] = "module/load/ultimate_games/play_more/54/0";
$route['game-choi-nhieu/trang-(:num)'] = "module/load/ultimate_games/play_more/54/$1";

$route['admin/logout'] = "admin/uindex/logout";
$route['mobile'] = "uindex/redirect/mobile/";
$route['sync'] = "server/auto_sync";
$route['default_controller'] = "uindex";
$route['404_override'] = 'uindex/page404';


/* End of file routes.php */
/* Location: ./application/config/routes.php */